package com.hyt.it.ogt.kq.service.bm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hyt.it.ogt.kq.service.bm.model.entity.ProjectDataDownLoadRecord;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 评卷项目表数据导出记录 Mapper 接口
 * </p>
 */
public interface ProjectDataDownLoadRecordMapper extends BaseMapper<ProjectDataDownLoadRecord> {


	/***
     * 获取导出记录的最新信息
     * @param projectId
     * @param officeid
     * @param fileType 
     * @return ProjectDataDownLoadRecord
     */
	ProjectDataDownLoadRecord getLastOneByProjectAndFileType(@Param("projectId") String projectId,@Param("officeId") String officeId, @Param("dlParam")String dlParam, @Param("permissions")String permissions, @Param("fileType") String fileType);

	
	/***
	 * 
	 * @param projectId
	 * @param officeId
	 * @param fileType
	 * @return
	 */
	Integer getLastOneByProjectAndFileTypeTimes(@Param("projectId") String projectId,@Param("officeId") String officeId, @Param("dlParam")String dlParam, @Param("permissions")String permissions, @Param("fileType") String fileType);


	List<ProjectDataDownLoadRecord> getIsRunningDownloadFileRecord(@Param("projectIds") List<String> projectIds, @Param("fileType") String fileType);

	
	/***
	 * 删除项目下所有的下载记录
	 * @param projectId  项目id
	 * @param updateDate  更新时间
	 * @param updateBy  更新人
	 */
	void deleteProjectRecord(@Param("projectId") String projectId, @Param("updateDate") LocalDateTime updateDate, @Param("updateBy") String updateBy);
}
